{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "from autocoder.index.symbols_utils import (\n",
    "    extract_symbols,\n",
    "    symbols_info_to_str,\n",
    "    SymbolsInfo,\n",
    "    SymbolType,\n",
    ")\n",
    "\n",
    "info = SymbolsInfo(\n",
    "            usage=\"Test usage\",\n",
    "            functions=[\"func1\", \"func2\"],\n",
    "            variables=[\"var1\", \"var2\"],\n",
    "            classes=[\"Class1\", \"Class2\"],\n",
    "            import_statements=[\"import os\", \"from typing import List\"],\n",
    "        )\n",
    "\n",
    "print(getattr(info, \"usage\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "__annotations__",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[16], line 5\u001b[0m\n\u001b[1;32m      2\u001b[0m field_info \u001b[38;5;241m=\u001b[39m AutoCoderArgs\u001b[38;5;241m.\u001b[39mmodel_fields\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhuman_as_model\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m      3\u001b[0m field_info\u001b[38;5;241m.\u001b[39mannotation\n\u001b[0;32m----> 5\u001b[0m \u001b[43mfield_info\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mannotation\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__annotations__\u001b[39;49m\n",
      "File \u001b[0;32m/opt/miniconda3/envs/byzerllm/lib/python3.10/typing.py:984\u001b[0m, in \u001b[0;36m_BaseGenericAlias.__getattr__\u001b[0;34m(self, attr)\u001b[0m\n\u001b[1;32m    982\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m__origin__\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__dict__\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m _is_dunder(attr):\n\u001b[1;32m    983\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__origin__, attr)\n\u001b[0;32m--> 984\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(attr)\n",
      "\u001b[0;31mAttributeError\u001b[0m: __annotations__"
     ]
    }
   ],
   "source": [
    "from autocoder.common import AutoCoderArgs\n",
    "field_info = AutoCoderArgs.model_fields.get(\"human_as_model\")\n",
    "field_info.annotation\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "byzerllm",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
